package us.versus.them.b3ge.minigames.cards.poker;

import us.versus.them.b3ge.minigames.cards.Card;

class PokerHandScore {
	public var rank:Int;
	public var used:Int;
	public var unused:Int;

	public function new( ?rank:Int = 0 , ?used:Int = 0 , ?unused:Int = 0 ) {
		this.rank   = rank;
		this.used   = used;
		this.unused = unused;
	}

	public function toString() {
		return this.rank + '.' + this.used + '.' + this.unused;
	}

	public static inline function compare( a:PokerHandScore, b:PokerHandScore ) {
		return if ( a.rank < b.rank ) {
			-1;
		} else {
			if ( a.rank > b.rank ) {
				1;
			} else {
				if ( a.used < b.used ) {
					-1;
				} else {
					if ( a.used > b.used ) {
						1;
					} else {
						if ( a.unused < b.unused ) {
							-1;
						} else {
							if ( a.unused > b.unused ) {
								1;
							} else {
								0;
							}
						}
					}
				}
			}
		}
	}
	// .sort( function( a, b ) { return Std.int( 1000000 * ( a.score - b.score ) ); } );

}
